package st.business.tepth.business.visitor.visitorwork.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * @author zhangyu
 * @date 2019/6/5
 */
public class WorkDetailBean {

    /**
     * repair : [{"repairPhenomenon":"发动机异响","repairDiagnose ":"发动机发吐,发动机坏","program":[{"person":"张三、李四","action":"更换","part":{"part":"发动机皮带轮","partNo":"12","partCount":1,"partUnit":"个","partSupply":"12"},"material":{"material":"发动机皮带轮","materialNo":"12","materialCount":1,"materialUnit":"个","materialSupply":"12"}}]}]
     * maintain : [{"workContent":"检查润滑水泵、节温器风扇,清洁检查发动机外部","workStandard":"作业标准","program":[{"person":"张三、李四","action":"更换","part":{"part":"发动机皮带轮","partNo":"12","partCount":1,"partUnit":"个","partSupply":"12"},"material":{"material":"发动机皮带轮","materialNo":"12","materialCount":1,"materialUnit":"个","materialSupply":"12"}}]}]
     * pass : {"person":"张三","state":"过检通过"}
     * finish : {"person":"张三","state":"竣检通过"}
     */

    private PassBean pass;
    private FinishBean finish;
    private String work;
    private ArrayList<RepairBean> repair;
    private ArrayList<MaintainBean> maintain;

    public String getWork() {
        return work;
    }

    public void setWork(String work) {
        this.work = work;
    }

    public PassBean getPass() {
        return pass;
    }

    public void setPass(PassBean pass) {
        this.pass = pass;
    }

    public FinishBean getFinish() {
        return finish;
    }

    public void setFinish(FinishBean finish) {
        this.finish = finish;
    }

    public ArrayList<RepairBean> getRepair() {
        return repair;
    }

    public void setRepair(ArrayList<RepairBean> repair) {
        this.repair = repair;
    }

    public ArrayList<MaintainBean> getMaintain() {
        return maintain;
    }

    public void setMaintain(ArrayList<MaintainBean> maintain) {
        this.maintain = maintain;
    }

    public static class PassBean implements Parcelable {
        /**
         * person : 张三
         * state : 过检通过
         */

        private String person;
        private String state;

        public String getPerson() {
            return person;
        }

        public void setPerson(String person) {
            this.person = person;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.person);
            dest.writeString(this.state);
        }

        public PassBean() {
        }

        protected PassBean(Parcel in) {
            this.person = in.readString();
            this.state = in.readString();
        }

        public static final Parcelable.Creator<PassBean> CREATOR = new Parcelable.Creator<PassBean>() {
            @Override
            public PassBean createFromParcel(Parcel source) {
                return new PassBean(source);
            }

            @Override
            public PassBean[] newArray(int size) {
                return new PassBean[size];
            }
        };
    }

    public static class FinishBean implements Parcelable {
        /**
         * person : 张三
         * state : 竣检通过
         */

        private String person;
        private String state;

        public String getPerson() {
            return person;
        }

        public void setPerson(String person) {
            this.person = person;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.person);
            dest.writeString(this.state);
        }

        public FinishBean() {
        }

        protected FinishBean(Parcel in) {
            this.person = in.readString();
            this.state = in.readString();
        }

        public static final Parcelable.Creator<FinishBean> CREATOR = new Parcelable.Creator<FinishBean>() {
            @Override
            public FinishBean createFromParcel(Parcel source) {
                return new FinishBean(source);
            }

            @Override
            public FinishBean[] newArray(int size) {
                return new FinishBean[size];
            }
        };
    }

    public static class RepairBean implements Parcelable {
        /**
         * repairPhenomenon : 发动机异响
         * repairDiagnose  : 发动机发吐,发动机坏
         * program : [{"person":"张三、李四","action":"更换","part":{"part":"发动机皮带轮","partNo":"12","partCount":1,"partUnit":"个","partSupply":"12"},"material":{"material":"发动机皮带轮","materialNo":"12","materialCount":1,"materialUnit":"个","materialSupply":"12"}}]
         */

        private String repairPhenomenon;
        private String repairDiagnose;
        private ArrayList<ProgramBean> program;

        public String getRepairPhenomenon() {
            return repairPhenomenon;
        }

        public void setRepairPhenomenon(String repairPhenomenon) {
            this.repairPhenomenon = repairPhenomenon;
        }

        public String getRepairDiagnose() {
            return repairDiagnose;
        }

        public void setRepairDiagnose(String repairDiagnose) {
            this.repairDiagnose = repairDiagnose;
        }

        public ArrayList<ProgramBean> getProgram() {
            return program;
        }

        public void setProgram(ArrayList<ProgramBean> program) {
            this.program = program;
        }

        public static class ProgramBean implements Parcelable {
            /**
             * person : 张三、李四
             * action : 更换
             * diagnose:"发动机皮带轮坏"
             * part : {"part":"发动机皮带轮","partNo":"12","partCount":1,"partUnit":"个","partSupply":"12"}
             * material : {"material":"发动机皮带轮","materialNo":"12","materialCount":1,"materialUnit":"个","materialSupply":"12"}
             */

            private String person;
            private String action;
            private String diagnose;
            private PartBean part;
            private MaterialBean material;

            public String getDiagnose() {
                return diagnose;
            }

            public void setDiagnose(String diagnose) {
                this.diagnose = diagnose;
            }

            public String getPerson() {
                return person;
            }

            public void setPerson(String person) {
                this.person = person;
            }

            public String getAction() {
                return action;
            }

            public void setAction(String action) {
                this.action = action;
            }

            public PartBean getPart() {
                return part;
            }

            public void setPart(PartBean part) {
                this.part = part;
            }

            public MaterialBean getMaterial() {
                return material;
            }

            public void setMaterial(MaterialBean material) {
                this.material = material;
            }

            public static class PartBean implements Parcelable {
                /**
                 * part : 发动机皮带轮
                 * partNo : 12
                 * partCount : 1
                 * partUnit : 个
                 * partSupply : 12
                 */

                private String part;
                private String partNo;
                private int partCount;
                private String partUnit;
                private String partSupply;

                public String getPart() {
                    return part;
                }

                public void setPart(String part) {
                    this.part = part;
                }

                public String getPartNo() {
                    return partNo;
                }

                public void setPartNo(String partNo) {
                    this.partNo = partNo;
                }

                public int getPartCount() {
                    return partCount;
                }

                public void setPartCount(int partCount) {
                    this.partCount = partCount;
                }

                public String getPartUnit() {
                    return partUnit;
                }

                public void setPartUnit(String partUnit) {
                    this.partUnit = partUnit;
                }

                public String getPartSupply() {
                    return partSupply;
                }

                public void setPartSupply(String partSupply) {
                    this.partSupply = partSupply;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeString(this.part);
                    dest.writeString(this.partNo);
                    dest.writeInt(this.partCount);
                    dest.writeString(this.partUnit);
                    dest.writeString(this.partSupply);
                }

                public PartBean() {
                }

                protected PartBean(Parcel in) {
                    this.part = in.readString();
                    this.partNo = in.readString();
                    this.partCount = in.readInt();
                    this.partUnit = in.readString();
                    this.partSupply = in.readString();
                }

                public static final Parcelable.Creator<PartBean> CREATOR = new Parcelable.Creator<PartBean>() {
                    @Override
                    public PartBean createFromParcel(Parcel source) {
                        return new PartBean(source);
                    }

                    @Override
                    public PartBean[] newArray(int size) {
                        return new PartBean[size];
                    }
                };
            }

            public static class MaterialBean implements Parcelable {
                /**
                 * material : 发动机皮带轮
                 * materialNo : 12
                 * materialCount : 1
                 * materialUnit : 个
                 * materialSupply : 12
                 */

                private String material;
                private String materialNo;
                private int materialCount;
                private String materialUnit;
                private String materialSupply;

                public String getMaterial() {
                    return material;
                }

                public void setMaterial(String material) {
                    this.material = material;
                }

                public String getMaterialNo() {
                    return materialNo;
                }

                public void setMaterialNo(String materialNo) {
                    this.materialNo = materialNo;
                }

                public int getMaterialCount() {
                    return materialCount;
                }

                public void setMaterialCount(int materialCount) {
                    this.materialCount = materialCount;
                }

                public String getMaterialUnit() {
                    return materialUnit;
                }

                public void setMaterialUnit(String materialUnit) {
                    this.materialUnit = materialUnit;
                }

                public String getMaterialSupply() {
                    return materialSupply;
                }

                public void setMaterialSupply(String materialSupply) {
                    this.materialSupply = materialSupply;
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeString(this.material);
                    dest.writeString(this.materialNo);
                    dest.writeInt(this.materialCount);
                    dest.writeString(this.materialUnit);
                    dest.writeString(this.materialSupply);
                }

                public MaterialBean() {
                }

                protected MaterialBean(Parcel in) {
                    this.material = in.readString();
                    this.materialNo = in.readString();
                    this.materialCount = in.readInt();
                    this.materialUnit = in.readString();
                    this.materialSupply = in.readString();
                }

                public static final Parcelable.Creator<MaterialBean> CREATOR = new Parcelable.Creator<MaterialBean>() {
                    @Override
                    public MaterialBean createFromParcel(Parcel source) {
                        return new MaterialBean(source);
                    }

                    @Override
                    public MaterialBean[] newArray(int size) {
                        return new MaterialBean[size];
                    }
                };
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.person);
                dest.writeString(this.action);
                dest.writeString(this.diagnose);
                dest.writeParcelable(this.part, flags);
                dest.writeParcelable(this.material, flags);
            }

            public ProgramBean() {
            }

            protected ProgramBean(Parcel in) {
                this.person = in.readString();
                this.action = in.readString();
                this.diagnose = in.readString();
                this.part = in.readParcelable(PartBean.class.getClassLoader());
                this.material = in.readParcelable(MaterialBean.class.getClassLoader());
            }

            public static final Parcelable.Creator<ProgramBean> CREATOR = new Parcelable.Creator<ProgramBean>() {
                @Override
                public ProgramBean createFromParcel(Parcel source) {
                    return new ProgramBean(source);
                }

                @Override
                public ProgramBean[] newArray(int size) {
                    return new ProgramBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.repairPhenomenon);
            dest.writeString(this.repairDiagnose);
            dest.writeTypedList(this.program);
        }

        public RepairBean() {
        }

        protected RepairBean(Parcel in) {
            this.repairPhenomenon = in.readString();
            this.repairDiagnose = in.readString();
            this.program = in.createTypedArrayList(ProgramBean.CREATOR);
        }

        public static final Parcelable.Creator<RepairBean> CREATOR = new Parcelable.Creator<RepairBean>() {
            @Override
            public RepairBean createFromParcel(Parcel source) {
                return new RepairBean(source);
            }

            @Override
            public RepairBean[] newArray(int size) {
                return new RepairBean[size];
            }
        };
    }

    public static class MaintainBean implements Parcelable {
        /**
         * workContent : 检查润滑水泵、节温器风扇,清洁检查发动机外部
         * workStandard : 作业标准
         * program : [{"person":"张三、李四","action":"更换","part":{"part":"发动机皮带轮","partNo":"12","partCount":1,"partUnit":"个","partSupply":"12"},"material":{"material":"发动机皮带轮","materialNo":"12","materialCount":1,"materialUnit":"个","materialSupply":"12"}}]
         */

        private String workContent;
        private String workStandard;
        private ArrayList<RepairBean.ProgramBean> program;

        public String getWorkContent() {
            return workContent;
        }

        public void setWorkContent(String workContent) {
            this.workContent = workContent;
        }

        public String getWorkStandard() {
            return workStandard;
        }

        public void setWorkStandard(String workStandard) {
            this.workStandard = workStandard;
        }

        public ArrayList<RepairBean.ProgramBean> getProgram() {
            return program;
        }

        public void setProgram(ArrayList<RepairBean.ProgramBean> program) {
            this.program = program;
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.workContent);
            dest.writeString(this.workStandard);
            dest.writeTypedList(this.program);
        }

        public MaintainBean() {
        }

        protected MaintainBean(Parcel in) {
            this.workContent = in.readString();
            this.workStandard = in.readString();
            this.program = in.createTypedArrayList(RepairBean.ProgramBean.CREATOR);
        }

        public static final Parcelable.Creator<MaintainBean> CREATOR = new Parcelable.Creator<MaintainBean>() {
            @Override
            public MaintainBean createFromParcel(Parcel source) {
                return new MaintainBean(source);
            }

            @Override
            public MaintainBean[] newArray(int size) {
                return new MaintainBean[size];
            }
        };
    }
}
